package edu.sandau.b230111.b23011121.respository;

import edu.sandau.b230111.b23011121.model.Teacher;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface TeacherRepository extends JpaRepository<Teacher,String> {
    List<Teacher> findByName(String name);

    List<Teacher> findByNameAndAge(String name, Integer age);

    List<Teacher> findByNameOrAge(String name, Integer age);

    @Query(nativeQuery = true,value ="select * from teacher where name = ?1")
    List<Teacher> findByNativeQuery(String name);

}
